﻿namespace BookStoreGUI
{

    /// <summary>
    /// Class defining operations to be performed on a list of books.
    /// </summary>
    class BooksListOperations
    {

        /// <summary>
        /// The operation defined for changing a book title.
        /// </summary>
        private ChangeBookTitleDelegate ChangeBookTitleMethod;

        /// <summary>
        /// The operation defined for deleting a book from the list.
        /// </summary>
        private DeleteBookDelegate DeleteBookMethod;


        /// <summary>
        /// BooksListOperations constructor.
        /// </summary>
        /// <param name="ChangeBookTitleMethod">The operation defined for changing a book title</param>
        /// <param name="DeleteBookMethod">The operation defined for deleting a book from the list</param>
        public BooksListOperations(ChangeBookTitleDelegate ChangeBookTitleMethod,
                                   DeleteBookDelegate DeleteBookMethod)
        {
            this.ChangeBookTitleMethod = ChangeBookTitleMethod;
            this.DeleteBookMethod = DeleteBookMethod;
        }


        /// <summary>
        /// Changes the book title.
        /// </summary>
        public void ChangeBookTitle()
        {
            ChangeBookTitleMethod();
        }


        /// <summary>
        /// Deletes the book from the list.
        /// </summary>
        public void DeleteBook()
        {
            DeleteBookMethod();
        }

    }

}
